﻿using Jurassic.Library;
using Kiwi.Node.Modules.Builtin;

namespace Kiwi.Node.Modules.Http
{
    public class Http: BuiltinModuleObject
    {
        public Http(IApplication application) : base(application)
        {
        }

        [JSFunction(Name = "createServer")]
        public HttpServer CreateServer(object callback)
        {
            var server = new HttpServer(Application);
            server.InternalAddListener("request", callback);
            return server;
        }
    }
}
